<?php


namespace App\Validators;


use App\Constants\AuthType;

class LoginValidator extends BaseValidator
{

    //验证规则
    protected $rule = [
        'name' => 'required',
        'password' => 'required|min:6',
        'register_type' => 'required',
    ];
    //自定义验证信息
    protected $message = [

    ];

    public function init()
    {
        $this->rule['register_type'] .= "|in:" . $this->checkRegisterType();
    }

    public function checkRegisterType()
    {
        return implode(",", array_keys(AuthType::$lib_register_type));
    }
}
